import rxAjax from '@/assets/js/ajax.js';

//视图历史记录 api接口
export const ScreenViewHistoryApi = {};

ScreenViewHistoryApi.baseUrl= '/api-screen/screen/core/screenViewHistory';
ScreenViewHistoryApi.exportUrl= ScreenViewHistoryApi.baseUrl + '/listExport';

//查询列表
ScreenViewHistoryApi.query=function (parameter) {
  let url= ScreenViewHistoryApi.baseUrl + '/query';
  return rxAjax.postJson(url,parameter).then (res => {
    return res.result
  })
}

/**
* 获取单记录
* @param pkId
* @returns {*}
*/
ScreenViewHistoryApi.get =function(pkId) {
  let url= ScreenViewHistoryApi.baseUrl + '/get?pkId=' + pkId;
  return rxAjax.get(url);
}

//保存数据
ScreenViewHistoryApi.save =function(parameter) {
  let url= ScreenViewHistoryApi.baseUrl + '/save';
  return rxAjax.postJson(url,parameter);
}

//删除数据
ScreenViewHistoryApi.del =function(parameter) {
  let url= ScreenViewHistoryApi.baseUrl + '/del';
  return rxAjax.postUrl(url,parameter);
}

/**
 * 获取历史记录
 * @returns {*}
 */
ScreenViewHistoryApi.getByViewId =function(viewId) {
	let url= ScreenViewHistoryApi.baseUrl + '/getByViewId?viewId='+viewId;
	return rxAjax.get(url);
}


export  default ScreenViewHistoryApi;

